/*
 * UserDAOImpl.java
 *
 * Created on April 26, 2007, 1:55 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.abbh.libcommunity.dao.impl;

import com.abbh.libcommunity.dao.UserDAO;
import com.abbh.libcommunity.model.User;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.Query;
/**
 *
 * @author Abdul Khader J Syed
 */
public class UserDAOImpl implements UserDAO{
    Session s;
    Transaction t;
    /** Creates a new instance of UserDAOImpl */
    public UserDAOImpl() {
         s=com.abbh.libcommunity.dao.LCHibernateUtil.currentSession();
        t=s.beginTransaction();
       
    }
       
    public  User findByUserId(Integer userId)
    {
         Query q=s.createQuery("select p from User p where p.id="+userId);
     User user=(User)q.uniqueResult();
     return user;
    }
    
    
}
